﻿@{
    ViewBag.Title = "MyProject";
    Layout = "~/Views/Shared/_Layout_manage.cshtml";
}

<div class="contentcontainer">
        <div class="headings altheading">
            <h2>我的项目列表</h2>
        </div>
        <div class="contentbox">
            <table width="100%">
                <thead>
                    <tr>
                        <th>编号</th>
                        <th>项目名称</th>
                        <th>状态</th>
                        <th>集资金额</th>
                        <th>已筹金额</th>
                        <th>提交时间</th>
                        <th>管理</th>
                        <th><input name="" type="checkbox" value="" id="checkboxall" /></th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in (IEnumerable<WmWebSystem.Models.Project>)ViewData["myProjects"])
                    {
                    <tr class="alt">
                        <td>
                            @Html.DisplayFor(modelItem => item.ProjectNo)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.ProjectName)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Status)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.TargetValue)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.CurrentValue)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.AddTime)
                        </td>
                        <td>
                            <a href="@Url.Action("Edit", "Project", new { id = item.ProjectId })" title=""><img src="@Url.Content("~/Content/zone/img/icons/icon_edit.png")" alt="Edit" /></a>
                            <a href="@Url.Action("ProjectView", "Project", new { No = item.ProjectNo })" title=""><img src="@Url.Content("~/Content/zone/img/icons/icon_approve.png")" alt="Details" /></a>
                        </td>
                        <td>
                            <input type="checkbox" value="@item.ProjectId" name="checkall" />
                        </td>
                    </tr>
                    <tr>
                        <th>关注次数</th>
                        <td>
                        @{
                            int count = 0;
                            foreach (var att in (IEnumerable<WmWebSystem.Models.Attention>)ViewData["Attentions"]) 
                            {
                                if (item.ProjectNo == att.ProjectNo)
                                {
                                    count = count + 1;
                                }
                            }
                            <span>@count</span>
                         }
                         
                        </td>
                        <th>项目进度</th>
                        <td colspan="5">
                          <div class="usagebox">
                              @{
                                decimal target= Convert.ToDecimal(item.TargetValue);
                                decimal current = Convert.ToDecimal(item.CurrentValue);

                                string n = (current / target).ToString("0.##%");
                                <div class="midbar" style="width:@n"></div>
                              }
                           </div>
                        </td>
                    </tr>
                    }
                </tbody>
            </table>
            <div style="clear: both;"></div>
        </div>     
    </div>
